
#pragma unmanaged
#pragma once

#include <windows.h>


#define WM_ADD_LOG  (WM_USER+10)


class Logger{
private:
	HWND m_listener;

	Logger(void){
		m_listener = NULL;
	}

public:
	static Logger* Instance(void){
		static Logger logger;
		return &logger;
	}

	static void SetListenerWindow(HWND listener){
		Instance()->m_listener = listener;
	}


	static void Log(char* str){
		Logger* inst = Logger::Instance();
		::SendMessage(inst->m_listener, WM_ADD_LOG, (WPARAM)str, 0);
	}
};

#pragma managed
